let elinp = document.querySelector('#linp');
let elpas = document.querySelector('#lpas');
let erinp = document.querySelector('#rinp');
let erpas = document.querySelector('#rpas');
let evrpas = document.querySelector('#vrpas');
let ebtlogin = document.querySelector('#btlogin');
let ebtrsave = document.querySelector('#btrsave');
let elck = document.querySelector('#lck');
ebtrsave.onclick=function(){
    if (erpas.value!==evrpas.value){
        alert('前后密码输入不一致');
        return;
    } 
    if(erinp.value.length<3){
        alert("昵称最少需要三位！");
        return;
    }
    if (erpas.value.length<8){
        alert("密码最低需要八位！");
        return;
    }
   
    if(localStorage.getItem(erinp.value)===null){
        localStorage.setItem(erinp.value,erpas.value);
        window.location.href='interFace/index.html';
    }
    else{
        alert('该用户名已被注册！');
    }
}
ebtlogin.onclick=function(){
    if(!elck.checked){
        alert("请勾选同意服务条款");
        return;
    }
    if (localStorage.getItem(elinp.value)!==elpas.value){
        alert('账户或密码错误');
        return;
    }
    window.location.href='interFace/index.html';
}